package com.twu.biblioteca;

/**
 * Created by abhishep on 3/5/14.
 */
public class BookMenu extends MenuClass {


    public BookMenu(Formatter formatter) {
        super(formatter);
    }

    @Override
    public void showMenu() {
        formatter.outputMessageToConsole("1.List Book  2.CheckOut Book  3.Return Book  4.Back");
    }

    public void getBookIsbn() {

        formatter.outputMessageToConsole("Enter the Isbn :");
    }

    @Override
    public String menuAction(Library library,int choice)
    {
        switch(choice)
        {
            case 1:
                return library.getBookList();

            case 2:
                getBookIsbn();
                String isbn = getUserInput();
                return library.checkOutBook(isbn);

            case 3:
                getBookIsbn();
                isbn = getUserInput();
                return library.returnBook(isbn);

            default:
                return "Not a valid option";
        }


    }


}
